//
//  HomeTJShopView.m
//  ai2ban
//
//  Created by mac book pro on 2018/1/10.
//  Copyright © 2018年 mac book pro. All rights reserved.
//

#import "HomeTJShopView.h"
#import <UIImageView+WebCache.h>

@implementation HomeTJShopView

-(instancetype)initWithFrame:(CGRect)frame andIcon:(NSString *)icon andTitle:(NSString *)shop andPrice:(NSString *)subTitle {
    
    if (self = [super initWithFrame:frame]) {
        
        UIImageView *iconImageView = [[UIImageView alloc] init];
        iconImageView.backgroundColor = [UIColor groupTableViewBackgroundColor];
        [iconImageView sd_setImageWithURL:[NSURL URLWithString:icon] placeholderImage:nil];
        iconImageView.frame = CGRectMake(0, 0, self.width, 156);
        [self addSubview:iconImageView];
        
        UILabel *title = [[UILabel alloc] init];
        title.frame = CGRectMake(0, iconImageView.bottom+12, iconImageView.width, 16);
        title.text = shop;
        title.font = [UIFont systemFontOfSize:12];
        title.textColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:1];
        title.textAlignment = NSTextAlignmentCenter;
        [self addSubview:title];
        
        UILabel *label = [[UILabel alloc] init];
        label.frame = CGRectMake(0, title.bottom+8, iconImageView.width, 18);
        label.text = subTitle;
        label.font = [UIFont boldSystemFontOfSize:13];
        label.textColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:1];
        label.textAlignment = NSTextAlignmentCenter;
        [self addSubview:label];
        [self addSubview:label];

        
    }
    
    return self;
    
}

@end
